Skip to content

Update make_future and train_test_split regressors handling #447

Merged
merged 7 commits into from
Jan 19, 2022

Conversation

alex-hse-repository
Copy link
Collaborator

@alex-hse-repository alex-hse-repository commented Jan 12, 2022

IMPORTANT: Please do not create a Pull Request without creating an issue first.

Before submitting (must do checklist)

  • Did you read the contribution guide?
  • Did you update the docs? We use Numpy format for all the methods and classes.
  • Did you write any new necessary tests?
  • Did you update the CHANGELOG?

Type of Change

  • Examples / docs / tutorials / contributors update
  • Bug fix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves an existing feature)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Proposed Changes

Related Issue

Closing issues

closes #443

@alex-hse-repository alex-hse-repository added the enhancement New feature or request label Jan 12, 2022
@alex-hse-repository alex-hse-repository added this to the Regressors 2.0 milestone Jan 12, 2022
@alex-hse-repository alex-hse-repository self-assigned this Jan 12, 2022
@alex-hse-repository alex-hse-repository linked an issue Jan 12, 2022 that may be closed by this pull request
1 task
@@ -278,7 +278,9 @@ def make_future(self, future_steps: int) -> "TSDataset":

future_dataset = df.tail(future_steps).copy(deep=True)
future_dataset = future_dataset.sort_index(axis=1, level=(0, 1))
future_ts = TSDataset(future_dataset, freq=self.freq)
future_ts = TSDataset(df=future_dataset, freq=self.freq)
future_ts.known_future = self.regressors
Copy link
Contributor

@Mr-Geekman Mr-Geekman Jan 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like we can pass known_future directly in constructor of TSDataset and it should be exactly known_future of current class, not just regressors.

@codecov-commenter
Copy link

codecov-commenter commented Jan 18, 2022

Codecov Report

❗ No coverage uploaded for pull request base (breaking_change/regressors@83f5cd9). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@                      Coverage Diff                      @@
##             breaking_change/regressors     #447   +/-   ##
=============================================================
  Coverage                              ?   87.67%           
=============================================================
  Files                                 ?       96           
  Lines                                 ?     4762           
  Branches                              ?        0           
=============================================================
  Hits                                  ?     4175           
  Misses                                ?      587           
  Partials                              ?        0           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 83f5cd9...60ae7fa. Read the comment docs.

@@ -278,7 +279,9 @@ def make_future(self, future_steps: int) -> "TSDataset":

future_dataset = df.tail(future_steps).copy(deep=True)
future_dataset = future_dataset.sort_index(axis=1, level=(0, 1))
future_ts = TSDataset(future_dataset, freq=self.freq)
future_ts = TSDataset(df=future_dataset, freq=self.freq)
future_ts.known_future = self.known_future
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we put this known future into the constructor of TSDataset on the previous line?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't, because the _check_known_future fails with df_exog=Null

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be a comment should be added about this

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve regressors handling in TSDataset
3 participants